package com.library.logging.controller;

import com.library.logging.annotation.LogSys;
import com.library.logging.modules.operationlog.vo.OperationLogVO;
import com.library.logging.modules.operationlog.bo.OperationLogPage;
import com.library.logging.modules.operationlog.service.OperationLogService;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.library.common.response.Result;
import jakarta.annotation.Resource;

/**
 * @Author xyh
 *
 * @Desc 操作日志表(OperationLog)表控制层
 * @Date 2023-10-05 14:42:50
 */

@RestController
@RequestMapping("operationlog")
public class OperationLogController {

    @Resource
    private OperationLogService operationLogService;


    /**
     * 操作日志分页查询列表
     *
     * @return 数据
     */
    @LogSys(value = "操作日志分页查询列表")
    @GetMapping("/dolog/list")
    public Result<IPage<OperationLogVO>> queryDoLogByPage(OperationLogPage page) {
        return Result.success(operationLogService.queryByPage(page));
    }

    /**
     * 登录/登出日志分页查询列表
     *
     * @return 数据
     */
    @LogSys(value = "登录/登出日志分页查询列表")
    @GetMapping("/loginlog/list")
    public Result<IPage<OperationLogVO>> queryLoginLogByPage(OperationLogPage page) {
        return Result.success(operationLogService.queryLoginLogByPage(page));
    }
}
